<%
	[res].user = getRes(getUser!);
 	// The resource parameter of the request is the current resource.
	.s = filterId(getp("resource"));
	.v = getp("version");
	[res].r= s=='' ? user : getRes(s);
	r.!rightsLevel(user)>=can.@Read ?
	(	.fparams={ defPath(r), getp("offset"), getp("size") };
		contentType='application/octet-stream';
		messageOutput=v==()?dbload(fparams):getDefVersion{r,0(v),fparams[1],fparams[2]};)
	: ( %>
		<html><body><p>No permission</p></body></html><%
    );
%>